<?php

class Admin_Form_Apiadd extends Zend_Form {

    public function init() {

        $this->setAction('/admin/api/add')
                ->setMethod('post');

        //server path
        $serverPath = new Zend_Form_Element_Text('server_path');
        $serverPath->setLabel('Server Path')
                ->setOptions(array('size' => '100'))
                ->addFilter('stringTrim');


        //api name
        $apiName = new Zend_Form_Element_Text('name');
        $apiName->setLabel('Api Name:')
                ->setOptions(array('size' => '30'))
                ->setRequired(true)
                ->addFilter('stringTrim');

        //api key
        $apiKey = new Zend_Form_Element_Text('api_key');
        $apiKey->setLabel('API KEY:')
                ->setOptions(array('size' => '50'))
                ->setRequired(true)
                ->addFilter('stringTrim');

        //api secret
        $apiSecret = new Zend_Form_Element_Text('api_secret');
        $apiSecret->setLabel('API Secret:')
                ->setOptions(array('size' => '50'))
                ->setRequired(true)
                ->addFilter('stringTrim');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Add')
                ->setOptions(array('class' => 'submit'))
                ->setAttrib('class', 'btn btn-success');


        //add to form
        $this->addElement($apiName)
                ->addElement($serverPath)
                ->addElement($apiKey)
                ->addElement($apiSecret)
                ->addElement($submit);
    }

}

